﻿using System;
using System.Data;
using System.Configuration;
using System.Web;


using System.Text;
/// <summary>
/// Summary description for Price
/// </summary>
/// 
namespace WorldExchange
{
    public class Price
    {
        #region "Memmber variable"
        private string _Ma;
        private string _Mua_CK;
        private string _Mua_TM;
        private string _Ban;
        #endregion

        #region "Property"
        public string Ma
        {
            get
            {
                return _Ma;
            }
            set
            {
                _Ma = value;
            }
        }
        public string Mua_CK
        {
            get
            {
                return _Mua_CK;
            }
            set
            {
                _Mua_CK = value;
            }
        }
        public string Mua_TM
        {
            get
            {
                return _Mua_TM;
            }
            set
            {
                _Mua_TM = value;
            }
        }
        public string Ban
        {
            get
            {
                return _Ban;
            }
            set
            {
                _Ban = value;
            }
        }
        #endregion

        #region "Constructor"
        public Price()
        {
        }
        public Price(string pMuaCK, string pMuaTM)
        {
            Mua_CK = pMuaCK;
            Mua_TM = pMuaTM;
        }
        public Price(string pMuaCK, string pMuaTM, string pBan)
        {
            Mua_CK = pMuaCK;
            Mua_TM = pMuaTM;
            Ban = pBan;
        }
        #endregion

        #region "Method"
        /// <summary>
        /// Trả về đối tượng ở dạng chuỗi theo cấu trúc JSON
        /// {
        ///     Ma: '---' ,
        ///     Mua_CK: '---',
        ///     Mua_TM: '---',
        ///     Ban: '---'
        /// }
        /// </summary>
        /// <returns></returns>
        public string toJsonObject()
        {
            StringBuilder ret = new StringBuilder();
            ret.Append("{Ma:'" + Ma + "',");
            ret.Append("Mua_CK:'" + Mua_CK + "',");
            ret.AppendFormat("Mua_TM:'{0}',", Mua_TM);
            ret.Append("Ban:'" + Ban + "'}");
            return ret.ToString();
        }
        #endregion
    }
}